﻿using System.Collections.Generic;
using Database.Context;
using Database.Models;


namespace QuanLyThongTinCoSo.Biz
{
    public abstract class BaseBiz
    {
        public Context DbContext;

        /// <summary>
        /// Insert data to database
        /// </summary>
        public abstract void Insert(BaseModel model);

        /// <summary>
        /// Update data to database
        /// </summary>
        public abstract void Update(BaseModel model);

        /// <summary>
        /// Delete an entity
        /// </summary>
        public abstract void Delete(BaseModel model);

        /// <summary>
        /// Delete list of items
        /// </summary>
        public abstract void DeleteItems(List<BaseModel> models);

        /// <summary>
        /// Get an item by id
        /// </summary>
        /// <param name="id">Item id</param>
        /// <returns>Return an existing item, otherwise return null </returns>
        public abstract BaseModel GetItemById(int id);
    }
}